package com.itheima.attendance.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.attendance.pojo.base.BaseEntity;
import com.itheima.attendance.pojo.vo.AtteUploadVo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author qiankaofei
 * @version 1.0
 * @date 2020/12/12 13:39
 */

@TableName("atte_attendance")
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class Attendance extends BaseEntity {
    private static final long serialVersionUID = 594829320797158219L;

    private String id;
    private String companyId;
    private String departmentId;

    private String userId;
    /**
     * 考勤状态
     */
    private Integer adtStatu;
    private long jobStatu;

    private Date adtInTime;
    private String adtInPlace;
    private String adtInHourse;

    private String adtInCoordinate;
    private Date adtOutTime;
    private String adtOutPlace;
    private String adtOutHourse;
    private String day; //考勤日期

    public  Attendance(AtteUploadVo vo, User user) {
        this.adtInTime = vo.getInTime();
        this.adtOutTime = vo.getOutTime();
        this.userId = user.getId();
        this.companyId = user.getCompanyId();
        this.departmentId = user.getDepartmentId();
        this.jobStatu = Long.parseLong(user.getInServiceStatus());
    }

}
